<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    (function () {
        function Tank() {
            this.dom = null;
            this.color = 'red'
            this.run = function () { }
        }
        let tanke = null;
        function gggg() {
            if (tanke) {
                return tanke
            } else {
                return tanke = new Tank()
            }
        }
        window.tttt = { gggg }
    })()
    let a = tttt.gggg()
    let b = tttt.gggg()
    let c = tttt.gggg()
    console.log(a == b && a == c && b == c);
</script>